package leetcode.动态规划.simple;

/**
 * @author wangmaolin1
 * @date 2022/1/10 下午10:01
 */
public class _509斐波那契数列 {

    public static int fib(int n) {
        if (n==0){
            return 0;
        }
        if (n==1){
            return 1;
        }
        int b[] = new int[n+1];
        b[0] = 0;
        b[1] = 1;
        for (int i = 2; i <= n; i++) {
            b[i]=b[i-1]+b[i-2];
            b[i]%=1000000007;
        }
        return b[n];
    }

    public static void main(String[] args) {
        System.out.println(fib(100));
    }

}
